<template>
	<view>
		<uv-tabbar :value="current?current:1" @change="changeTab" :fixed="true" :safeAreaInsetBottom="true"
			:border="true" :placeholder="true" activeColor="#2D73F0" inactiveColor="#333">
			<uv-tabbar-item v-for="(item,index) in list" :key="item" :name="item.id" :text="item.text">
				<image class="u-page__item__slot-icon" slot="active-icon" :src="item.selectedIconPath"></image>
				<image class="u-page__item__slot-icon-index" slot="inactive-icon" :src="item.iconPath"></image>
			</uv-tabbar-item>
		</uv-tabbar>
	</view>
</template>
<script>
	import store from '@/store'
	export default {
		name: "tabbar",
		data() {
			return {
				currentTab: 0,
				list: this.$store.state.dynamicTabbar, // 导航栏的列表项，来源于Vuex状态管理中的dynamicTabbar
			}
		},
		methods: {
			changeTab(e) {
				uni.switchTab({
					url: this.list[e - 1].pagePath,
				})
			}
		}

	}
</script>
</script>

<style scoped>
	.u-page__item__slot-icon {
		width: 25px !important;
		height: 25px !important;
	}

	.u-page__item__slot-icon-index {
		width: 25px !important;
		height: 25px !important;
	}

	/deep/ .u-tabbar__content__item-wrapper.data-v-542a922e {
		height: 80px !important;
	}
</style>